package com.huirui.server.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

@Schema(description = "收货地址DTO类，用于地址信息的传输和接收")
@Data
public class DeliveryAddressDTO {

    @Schema(description = "收货地址ID")
    private Long id;

    @Schema(description = "收货人姓名", example = "李四", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "收货人姓名不能为空")
    private String receiverName;

    @Schema(description = "收货人手机号码", example = "13912345678", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "收货人手机号码不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号码格式不正确")
    private String receiverPhone;

    @Schema(description = "省份", example = "江苏省", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "省份不能为空")
    private String province;

    @Schema(description = "城市", example = "苏州市", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "城市不能为空")
    private String city;

    @Schema(description = "区/县", example = "工业园区", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "区/县不能为空")
    private String district;

    @Schema(description = "详细地址", example = "星湖街123号创意产业园B栋501室", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "详细地址不能为空")
    private String detailAddress;

    @Schema(description = "是否默认地址：0-否，1-是", example = "0", defaultValue = "0",
            allowableValues = {"0", "1"}, requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "是否默认地址不能为空")
    private Integer isDefault;

}
    
